package elitech.vietnam.myfashion.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.koushikdutta.urlimageviewhelper.UrlImageViewHelper;

import elitech.vietnam.myfashion.R;
import elitech.vietnam.myfashion.config.Const;
import elitech.vietnam.myfashion.entites.Product;

public class RecommendView extends LinearLayout {
	private Product mProduct;
	private ImageView mImage;
	private TextView mTxtName;
	public RecommendView(Context context, Product product) {
		super(context);
		this.mProduct = product;
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		if(inflater != null){
            inflater.inflate(R.layout.item_recommend, this);
        }
		
		mImage = (ImageView) findViewById(R.id.recommend_img);
		mTxtName = (TextView) findViewById(R.id.recommend_txtName);
		
		UrlImageViewHelper.setUrlDrawable(mImage, Const.SERVER_IMAGE_URL
				+ product.Image, R.drawable.loading300);
		
		mTxtName.setText(product.Name + "");
		
	}

}
